package org.example.realtime.jtp.dwd.log.job;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Title: Test2
 * @Author Lianzy
 * @Package org.example.realtime.jtp.dwd.log.job
 * @Date 2025/5/22 21:44
 * @description 监听端口777
 */
public class Test2 {
    public static void main(String[] args) throws Exception {
        //1.执行环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        //监听端口
        DataStreamSource<String> stream = env.socketTextStream("node101", 7777);
        //输出数据
        stream.print();
        //执行
        env.execute();

    }
}
